import { reactive, ref } from 'vue'

export const loginForm = reactive({
  username: '',
  password: '',
})

export const registerForm = reactive({
  username: '',
  password: '',
  phone: '',
  email: '',
})

export const loginRules = reactive({
  username: [
    {
      required: true,
      message: '用户名不能为空',
      trigger: 'blur',
    },
  ],
  password: [
    {
      required: true,
      message: '密码不能为空',
      trigger: 'blur',
    },
  ],
  verifyCode: [
    {
      required: true,
      message: '验证码不能为空',
      trigger: 'blur',
    },
  ],
})

export const registerRules = reactive({
  username: [
    {
      required: true,
      message: '用户名不能为空',
      trigger: 'blur',
    },
  ],
  password: [
    {
      required: true,
      message: '密码不能为空',
      trigger: 'blur',
    },
  ],
  email: [
    {
      required: true,
      message: '邮箱不能为空',
      trigger: 'blur',
    },
  ],
  phone: [
    {
      required: true,
      message: '手机号不能为空',
      trigger: 'blur',
    },
  ],
})

export const TaskRules = reactive({
  name: [
    {
      required: true,
      message: '待办名称不能为空',
      trigger: 'blur',
    },
  ],
})

export const TaskRuleFormRef = ref(null)

export const loginRuleFormRef = ref(null)

export const registerRuleFormRef = ref(null)

export const taskForm = ref(null)
